<?php
spl_autoload_register('FR_autoloader');

function FR_autoloader($class) {
    if (substr($class,0,8)!="PHPUnit_" && substr($class,0,8)!="Composer") {
        if (substr($class, 0, 3) == "FR_") {
            $file = str_replace('_', '/', substr($class, 2)) . '.php';
            require_once(FR_ROOT . '/lib/includes' . $file);
        } else if (substr($class, 0, 6) == "model_") {
            require_once(FR_ROOT . '/models/' . substr($class, 6)) . ".php";
        } else {
            require_once(FR_ROOT . '/lib/classes/class_' . $class . ".php");
        }
    }
}